home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / GAME / Xconq 7.0.1.sit / Xconq 7.0.1 / lib / fantasy.g < prev    next >
Text File  |  1995-08-22  |  41KB  |  1,044 lines

  1. (game-module "fantasy"
  2.   (title "Swords and Sorcery")
  3.   (blurb "Fantasy warfare period...")
  4.   (variants
  5.    (see-all false)
  6.    (world-seen false)
  7.    (world-size)
  8.    )
  9. )
  10.  
  11. ; movers & fighters
  12. (unit-type W (name "wizard") (char "W")
  13.   (help "Magician, wielder awesome magic"))
  14. (unit-type i (name "light infantry") (char "i")
  15.   (help "Foot soldiers and mercenaries."))
  16. (unit-type b (name "barbarian") (char "b")
  17.   (help "Rugged, ferocious, lightly armoured warriors."))
  18. (unit-type k (name "heavy infantry") (char "k")
  19.   (help "Foot soldiers in heavy armour"))
  20. (unit-type P (name "paladin") (char "P")
  21.   (help "Holy warrior, extremely tough and well equipped"))
  22. (unit-type R (name "longbowmen") (char "R")
  23.   (help "Archers, scouts, rangers"))
  24. (unit-type H (name "priest") (char "H")
  25.   (help "The Spiritual guides of the land"))
  26. (unit-type s (name "serfs") (char "s")
  27.   (help "Mobs of Peasant serfs and levies"))
  28. (unit-type D (name "dragon") (char "D")
  29.   (help "Dragon, lays waste to the lands"))
  30. (unit-type u (name "undead") (char "u")
  31.   (help "Undead warriors, raised by priests or wizards"))
  32. (unit-type h (name "Horse Cavalry") (char "h")
  33.   (help "Knights that ride horses."))
  34.  
  35. ; magical effects
  36. (unit-type A (name "Armageddon spell") (char "A")
  37.   (help "spell of awesome destruction"))
  38. (unit-type L (name "Lightning spell") (char "L")
  39.   (help "spell good for killing tough things"))
  40. (unit-type F (name "Fireball spell") (char "F")
  41.   (help "spell great for causing lots of damage to soft targets"))
  42. (unit-type M (name "Mass Charm") (char "M")
  43.   (help "spell that charms units over to the caster's side!"))
  44. (unit-type E (name "Wizard Eye") (char "E")
  45.   (help "spell for spying on things"))
  46.  
  47. ; transport
  48. (unit-type G (name "wagon") (char "G")
  49.   (help "Wagons, logistical unit"))
  50. (unit-type C (name "flying carpet") (char "C")
  51.   (help "Magical flying carpet"))
  52. (unit-type cloudkeep (char "K") (image-name "city30")
  53.   (help "wizard's floating keep"))
  54. (unit-type S (name "sailing ship") (char "S")
  55.   (help "ship, for traveling the seas"))
  56. (unit-type g (name "galley") (char "g")
  57.   (help "fast, light, not so seaworthy warship"))
  58.  
  59. ; forts, bases and other special places
  60. (unit-type w (name "wall") (char "w")
  61.   (help "fortified walls"))
  62. (unit-type c (name "castle") (char "c")
  63.   (help "walled castle"))
  64. (unit-type tower (char "T")
  65.   (help "fortified mage's tower"))
  66. (unit-type / (name "camp") (char "/")
  67.   (help "campsite, practically a mobile village"))
  68. (unit-type temple (char "t") (image-name "parthenon")
  69.   (help "holy place of spiritual power"))
  70.  
  71. ; cities
  72. (unit-type V (name "village") (char "V")
  73.   (help "small town"))
  74. (unit-type * (name "town") (char "*")
  75.   (help "smaller than a city"))
  76. (unit-type @ (name "city") (char "@")
  77.   (help "Large city, seat of a city-state"))
  78.  
  79. ; magical items
  80. (unit-type r (name "ring of regeneration") (char "r")
  81.   (help "magical ring that makes its wearer heal faster"))
  82. (unit-type B (name "crystal ball") (char "B")
  83.   (help "magical device that scans the local area"))
  84. (unit-type p (name "ring of protection") (char "p")
  85.   (help "protective magical device"))
  86. (unit-type f (name "everfull plate") (char "f")
  87.   (help "magical wondor that creates food!"))
  88. (unit-type a (name "amulet of power") (char "a")
  89.   (help "generates mana for its wearer"))
  90.  
  91. (material-type food (help "Foodstuffs: an army marches on its stomach!"))
  92. (material-type mana (help "Magical power"))    ; used to produce magical effects
  93. (material-type metal (help "Steel, metal, manufacturing capacity for armour and weapons"))
  94.  
  95. (terrain-type sea (char ".") (color "sky blue"))
  96. (terrain-type swamp (char "=") (color "yellowgreen"))
  97. (terrain-type desert (char "~") (color "yellow"))
  98. (terrain-type plains (char "+") (color "green"))
  99. (terrain-type forest (char "%") (color "forest green"))
  100. (terrain-type hills (char "(") (color "khaki"))
  101. (terrain-type mountains (char "^") (color "sienna"))
  102. (terrain-type ice (char "_") (color "white"))
  103. (terrain-type void (char ":") (color "black"))
  104.  
  105. (define t temple)
  106. (define T tower)
  107. (define K cloudkeep)
  108.  
  109. (add W image-name "wizard")
  110. (add i image-name "hoplite")
  111. (add b image-name "viking")
  112. (add k image-name "knight")
  113. (add P image-name "paladin")
  114. (add R image-name "archer")
  115. (add H image-name "holy-man")
  116. (add s image-name "serf")
  117. (add D image-name "dragon")
  118. (add u image-name "undead")
  119.  
  120. (add A image-name "mininuke")
  121. (add L image-name "lightning")
  122. ;"FireBall" F icon-name
  123. (add F image-name "fire")
  124. (add M image-name "charm-spell")
  125. (add E image-name "eye")
  126.  
  127. (add G image-name "wagon-2")
  128. (add C image-name "flying-carpet")
  129. (add h image-name "cavalry")
  130. (add S image-name "frigate")
  131. (add g image-name "trireme")
  132.  
  133. (add w image-name "walltown")
  134. (add c image-name "castle")
  135. (add / image-name "camp")
  136. (add V image-name "village")
  137. (add * image-name "town20")
  138. (add @ image-name "city20")
  139.  
  140. (add r image-name "ring-2")
  141. (add p image-name "ring-2")
  142. (add B image-name "crystal-ball")
  143. (add f image-name "plate")
  144. (add a image-name "amulet")
  145.  
  146. (define bases ( w c tower temple cloudkeep / V * @ ))
  147. (define cities ( V * @ ))
  148. (define spells ( A L F M E ))
  149. (define forts ( w c tower cloudkeep ))
  150. (define flyers ( D C cloudkeep ))
  151. (define ships ( S g ))
  152. (define ltfoot ( H R b i s w ))
  153. (define hvyfoot ( k P W ))
  154. (define hoof ( h G ))
  155. (define magickers ( W D ))
  156. (define movers ( W i b k P R H s D u G C cloudkeep h S g ))
  157. (define foot ( W i b k P R H s u ))
  158. (define transport ( G C cloudkeep S g ))
  159. (define magicitems ( r B p f a ))
  160.  
  161. (define water ( sea ))
  162. (define land ( swamp plains forest desert hills mountains ))
  163.  
  164. ;;; Static relationships.
  165.  
  166. ;; Unit-unit.
  167.  
  168. ;  What units can carry which others
  169. ;
  170. ; format:
  171. ; (#) (units) unit1 capacity -- # of units unit1 can hold.
  172.  
  173. ;FIX unit-size-as-occupant is U1 U2 -> N U1's size as occupant of U2
  174. (table unit-size-as-occupant add (spells u* 1))
  175.  
  176. ;FIX occupant-max is U1 U2 -> N upper limit on occupants by type
  177. (table occupant-max add (W spells 6))
  178. (table occupant-max add (u* magicitems 6))
  179. (table occupant-max add (W u 1))    ; wizards can hold the undead they make.
  180. ;FIX capacity is N, upper limit on total occupants by size
  181. (add W capacity 10)
  182.  
  183. (table occupant-max add (D spells 1))
  184. (table occupant-max add (D ( L F ) 3))
  185. (table occupant-max add (D ( W k P ) 1))    ; dragonriders?
  186. (add D capacity 3)    ; yes, riders take up one of a dragon's spell slots
  187. ; odd, but necessary
  188.  
  189. (table occupant-max add (G ( W i b k P R H s u ) 2))
  190. (add G capacity 2)
  191.  
  192. (table occupant-max add (H u 1))    ; so they can be made!
  193. (add H capacity 1)
  194.  
  195. (table occupant-max add (S ( W i b k P R H s G h u ) 5))
  196. (add S capacity 5)
  197.  
  198. (table occupant-max add (C ( W i k P R H s ) 1))
  199. (add C capacity 1)
  200.  
  201. (table occupant-max add (g ( W i b k P R H s u ) ( 1 1 4 1 1 2 1 1 3 )))
  202. (add g capacity 4)
  203.  
  204. ; bases capacity
  205. (table occupant-max add (w ( W i b k P R H s G h u C ) 2))
  206. (add w capacity 2)
  207.  
  208. (table occupant-max add (K ( W k P R s D u C ) 4))
  209. (add cloudkeep capacity 8)
  210.  
  211. (table occupant-max add (c ( W i b k P R H s G h S g u ) 3))
  212. (add c capacity 4)
  213.  
  214. (table occupant-max add (T ( W i b k P R H s G h u C ) 2))
  215. (add tower capacity 4)
  216.  
  217. (table occupant-max add (/ ( W i b k P R H s G h S g C ) 6))
  218. (add / capacity 12)
  219.  
  220. (table occupant-max add (V ( W i b k P R H s G h S g C ) 8))
  221. (add V capacity 16)
  222.  
  223. (table occupant-max add (t ( W i b k P R H s G h S g C ) 6))
  224. (add temple capacity 10)
  225.  
  226. (table occupant-max add (* ( W i b k P R H s G h S g C ) 8))
  227. (add * capacity 20)
  228.  
  229. (table occupant-max add (@ ( W i b k P R H s G h S g C ) 15))
  230. (table occupant-max add (@ D 1))
  231. (add @ capacity 30)
  232.  
  233. (table occupant-max add (( T cloudkeep ) spells 2))
  234. ; 1 A ( T cloudkeep ) capacity ; armageddon spell is 'bigger'?
  235.  
  236. (table unit-size-as-occupant add (movers u* 1))
  237. (table unit-size-as-occupant add (( D G h S G ) u* ( 3 2 2 4 3 )))    ;  the exceptions
  238. (table unit-size-as-occupant add (spells u* 1))
  239.  
  240. ; 90 foot h alter-mobility ; h slowed by holding things?
  241.  
  242. (table unit-size-as-occupant add (magicitems u* 0))
  243. (table occupant-max add (u* magicitems 5))    ; rule of 5 magic items, but everything can hold them
  244. (table occupant-max add (spells magicitems 0))    ; except spells
  245. (table occupant-max add (magicitems u* 0))    ; and other magic items!
  246.  
  247. ;; Unit-terrain.
  248.  
  249. ;; Unit-material.
  250.  
  251. (table unit-storage-x 
  252.   (W m* ( 10 100 6 ))
  253.   (i m* ( 16  0 10 ))
  254.   (b m* ( 16  0  6 ))
  255.   (k m* ( 16  0 12 ))
  256.   (P m* ( 12  4  6 ))
  257.   (R m* ( 16  0  6 ))
  258.   (H m* ( 10  8  6 ))
  259.   (s m* ( 10  0  6 ))
  260.   (D m* ( 200 30 6 ))    ; dragons can eat alot!
  261.   (u m* (  0  0  4 ))
  262.   (spells food 0)
  263.   (spells metal 0)
  264.   (spells mana 3)
  265.   (L mana 2)
  266.   (E mana 8)    ; it has extra duration
  267.   (C m* (  0  10 2 ))
  268.   (G m* ( 150 0  6 ))
  269.   (K m* ( 50 200 10 ))
  270.   (h m* ( 50  0 20 ))
  271.   (S m* ( 100 0 30 ))
  272.   (g m* (  50 0 15 ))
  273.   (w m* (  20 0  6 ))
  274.   (c m* ( 200 0 30 ))
  275.   (T m* ( 100 60 20 ))
  276.   (/ m* ( 100 0 25 ))
  277.   (t m* ( 100 8 20 ))
  278.   (V m* ( 150 0 15 ))
  279.   (* m* ( 300 0 30 ))
  280.   (@ m* ( 600 0 60 ))
  281.   (r m* 10)
  282.   (f food 10)
  283.   (a mana 100)    ; holds lots of power, might have it all when found!
  284.   )
  285.  
  286. ;;; Vision.
  287.  
  288. (add ( V * @ ) see-always 1)
  289. (add D see-always 1)    ; Dragons are hard to miss...
  290.  
  291. ;(add u* vision-at 1)
  292. ;(add spells vision-at 0)
  293. ;(add E vision-at 4)    ; the spy-eye!
  294. ;(add flyers vision-at 3)
  295. ;(add bases vision-at 2)
  296. ;(add cloudkeep vision-at 5)
  297. ;(add T vision-at 4)    ; Towers are good for spotting things
  298. ;(add w vision-at 2)    ; can see a little ways from walls.
  299. ;(add @ vision-at 3)    ; cities have tall structures, and people wandering.
  300. ;(add * vision-at 2)
  301. ;(add c vision-at 3)
  302. ;(add R vision-at 2)    ; Archers are good at knowing the surrounding land.
  303. ;(add ( g S ) vision-at ( 2 3 ))    ; ships can see far over flat water
  304.  
  305. ; visibility of stuff
  306. ; non 0/1 visibility must be harsh on CPU! keep # of units with this down
  307. ;FIX visibility is U T -> N, U's % visibility in T
  308. (table visibility add (K t* 20))    ; hard to spot in them clouds!
  309. (table visibility add (C t* 5))    ; hard to spot in the clouds
  310. (table visibility add (R t* 50))    ; Archers are good at hiding on the land.
  311. (table visibility add (E t* 0))    ; invisible spy-eye
  312. (table visibility add (magicitems t* 20))    ;  magic items are sometimes hard to spot.
  313.  
  314. ; small forces hidden by rough terrain
  315. ;FIX conceal is now visibility, you should subtr these numbers from that table
  316. ;FIX ( 80 75 60 40 ) ( forest swamp mountains hills ) R conceal
  317.  
  318. ;;; Actions.
  319.  
  320. ;                         ( W i b k P R H s  D u G C  K h S g ) "movers"
  321. (add movers acp-per-turn (  1 2 3 2 2 3 2 1 10 1 5 12 4 6 5 7 ))
  322.  
  323. ;                         ( A L F M E ) "spells"
  324. (add spells acp-per-turn (  2 9 5 3 6 ))
  325.  
  326. (add cities acp-per-turn 1)
  327.  
  328. ;;; Movement.
  329.  
  330. (add bases speed 0)
  331. (add cities speed 0)
  332.  
  333. (table mp-to-enter-terrain
  334.   (u* t* 99)
  335.   (bases land 1)    ; so you can build bases anywhere?
  336.   (ships sea 1)    ; seas  -- ships Ok, air OK, most others, no go.
  337.   (flyers t* 1)    ; flyers can go almost anywhere.
  338.   (spells t* 1)    ; same for spells
  339.   (ships water 1)    ; sea is pretty straightforward...
  340.   ; movement on terrain...
  341.   ;( W i b k P R H s  D u A L F G C K h S g ) "movers"
  342.   ; ground units and land terrain:
  343.   ; ( swamp plains forest desert hills mountains ) "land"
  344.   ; ground units ant how they handle terrain:
  345.   (W land (2 1 1 1 1 2))
  346.   (i land (2 1 1 1 1 2))
  347.   (b land (2 1 2 1 1 2))
  348.   (k land (2 1 2 2 2 2))
  349.   (P land (1 1 1 1 2 2))
  350.   (R land (1 1 1 1 1 2))
  351.   (H land (2 1 2 2 2 2))
  352.   (s land (2 1 2 1 2 2))
  353.   (u land (1 1 1 1 1 2))
  354.   (G land (99 1 2 2 3 4))
  355.   (h land (3 1 2 2 3 4))
  356.   (( W b G P R u ) ice 1)    ; units that can handle ice!
  357.   (u* void 99)    ; nothing can go into the void!
  358.   )
  359.  
  360. (table consumption-per-move add (movers food 1))    ; all units take 1 fuel to move
  361. (table consumption-per-move add (s food 4))    ; this is actually lost food production
  362. ; Magical things don't require food to move....
  363. (table consumption-per-move add (u food 0))    ; undead dont eat!
  364. (table consumption-per-move add (K food 0))
  365. (table consumption-per-move add (K mana 1))    ; floating castle requires mana to move
  366. (table consumption-per-move add (spells food 0))
  367. (table consumption-per-move add (C food 0))
  368. (table consumption-per-move add (S food 0))    ; they sail!
  369.  
  370. ;;; Construction.
  371.  
  372. ; starting stockpiles
  373. ;FIX this used to be % now it is a raw number.
  374. (table supply-on-completion add (u* m* 0))    ; we don't start with any resources
  375. (table supply-on-completion add (u* food 100))    ; except food...
  376.  
  377. (table supply-on-completion add (bases food 50))    ; bases are only half full. filled units?
  378. (table supply-on-completion add (magickers mana 30))    ; magic casters get 30% of their mana capacity
  379.  
  380. ; production by units.
  381. ; Unit production time should be starting at a base value, and modified
  382. ; by how good the producer is at that particular unit...
  383. ; Base times:
  384. ;  W  i  b  k  P  R  H  s  D  u  A  L  F  M  G  h  C  K  S  g
  385. ; 25  5  8 10 15  9 15  5 30  2  2  2  2  2
  386. ; note: short times for spells compensated by large mana costs
  387. ;  w  c  T  /  t  V  *  @
  388. ;  5 20 15  5 12 30 35 40
  389. ;
  390. ;
  391. ; magickers production
  392. ;FIX make is replaced by acp-to-create, cp-per-build and friends
  393. ;FIX 2 spells W make
  394. ;FIX ( 25 2 10 30 10 ) ( D u C K T ) W make    ; wiz's make magic stuff
  395. ;FIX 2 ( F L ) D make
  396.  
  397. ; first, production by city-type units
  398. ;FIX ( 2 2 30 20 ) ( A L D W ) K make
  399.  
  400. ;FIX 15 temple P make    ; paladins can make shrines, eventually
  401.  
  402. ;FIX 7 / R make    ; Archers can camp...
  403.  
  404. ;FIX ( 11 5 ) ( temple u ) H make    ; 'holy' men can make undead?
  405. ;FIX ( 6 25 15 6 10 30 35 40 ) ( w c T / t V * @ ) s make    ;serfs make lots of stuff
  406.  
  407. ;FIX ( 10 17 5 15 ) ( k P i h ) c make    ; Castles
  408.  
  409. ;FIX ( 12 20 ) ( H P ) temple make
  410. ;FIX (  8 25 6 ) ( w c / ) i make
  411.  
  412.  
  413. ;      i b  R  H s G  h  S  g  W  k  P ) make vector
  414. ;FIX ( 6 8 10 18 6 7 18 19 16          ) ( i b R H s G h S g       ) V make
  415. ;FIX ( 5 5 11 15 5 7 16 14 13 32  9    ) ( i b R H s G h S g W k   ) * make
  416. ;FIX ( 4 4 11 13 5 6 14 13 11 25  7 20 ) ( i b R H s G h S g W k P ) @ make
  417.  
  418. (add ( i b  R  H s G  h  S  g  W  k  P )
  419.   cp ( 6 8 10 18 6 7 18 19 16 30  9 20))
  420.  
  421. (table acp-to-create
  422.   (T W 1)
  423.   (cities ( i b  R  H s G  h  S  g ) 1)
  424.   (( * @ ) ( W  k  P ) 1)
  425.   )
  426.  
  427. (table cp-on-creation
  428.   (T W 1)
  429.   (cities ( i b  R  H s G  h  S  g  ) 1)
  430.   ;; Towns and cities build faster by having new units more complete.
  431.   (* ( i b  R  H s G  h  S  g  W  k  P )
  432.      ( 2 2  1  4 2 1  3  6  4  1  1  1 ))
  433.   (@ ( i b  R  H s G  h  S  g  W  k  P )
  434.      ( 3 3  1  6 2 2  5  7  8  6  3  1 ))
  435.   )
  436.  
  437. (table acp-to-build
  438.   (T W 1)
  439.   (cities ( i b  R  H s G  h  S  g  W  k  P ) 1)
  440.   )
  441.  
  442. (table cp-per-build
  443.   (T W 1)
  444.   (cities ( i b  R  H s G  h  S  g  W  k  P ) 1)
  445.   )
  446.  
  447. ;; Material needed to make units.
  448.  
  449. ;  mana required for magical stuff
  450. ; typical mage should get 2 to 4 mana per turn, dep on site...
  451. (table consumption-per-build
  452.   ;                A  L   F  M  E  spells
  453.   (spells mana (  50 14  12 20  6 ))
  454.   (( D u cloudkeep C ) mana ( 200 10 400 80 ))
  455.   ; most units don't really take food to make...
  456.   ; but armoured ones take metal...
  457.   (i metal 3)
  458.   (k metal 15)
  459.   (P metal 15)
  460.   (G metal 5)
  461.   (S metal 40)
  462.   (g metal 25)
  463.   (w metal 20)
  464.   (c metal 80)
  465.   (T metal 20)
  466.   (/ metal 3)
  467.   (V metal 45)
  468.   (* metal 60)
  469.   (@ metal 120)
  470.   (magicitems mana ( 30 20 25 10 60 ))
  471.   )
  472.  
  473. ; mages must first figure out how to cast their spells!
  474. ;FIX 200 spells research
  475. ;FIX 300 M research
  476. ;FIX 1000 A research
  477.  
  478. ;;; Repair.
  479.  
  480. ; do this by what a unit may repair
  481. ;FIX hp-per-repair is U1 U2 -> .01HP that U1 restores to U2 per repair action
  482. ; ...and you have to add...
  483. ; acp-to-repair is U1 U2 -> ACP to do one repair action
  484. ;(table acp-to-repair add ( W 1))
  485. ;(table hp-per-repair add ( W ( 33 33 33 25 50 33 33 33 33 50 33 33 33 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 )))
  486. (table acp-to-repair add (i bases 1))
  487. (table hp-per-repair add (i bases 50))
  488. (table acp-to-repair add (b g 1))
  489. (table hp-per-repair add (b g 50))
  490. (table acp-to-repair add (b bases 1))
  491. (table hp-per-repair add (b bases 33))
  492. (table acp-to-repair add (k c 1))
  493. (table hp-per-repair add (k c 50))
  494. (table acp-to-repair add (P bases 1))
  495. (table hp-per-repair add (P bases 50))
  496. (table acp-to-repair add (P P 1))
  497. (table hp-per-repair add (P P 50))    ; paladin's healing powers!
  498. (table acp-to-repair add (R ( R / ) 1))
  499. (table hp-per-repair add (R ( R / ) 50))
  500. (table acp-to-repair add (s s 1))
  501. (table hp-per-repair add (s s 33))
  502. (table acp-to-repair add (H foot 1))
  503. (table hp-per-repair add (H foot 100))
  504. (table acp-to-repair add (s bases 1))
  505. (table hp-per-repair add (s bases 100))
  506. (table acp-to-repair add (s G 1))
  507. (table hp-per-repair add (s G 100))
  508. (table acp-to-repair add (s S 1))
  509. (table hp-per-repair add (s S 50))
  510. (table acp-to-repair add (D D 1))
  511. (table hp-per-repair add (D D 100))
  512. (table acp-to-repair add (h h 1))
  513. (table hp-per-repair add (h h 25))
  514. (table acp-to-repair add (u* u 1))
  515. (table hp-per-repair add (u* u 100))    ; undead can't be repaired...
  516. (table acp-to-repair add (W cloudkeep 1))
  517. (table hp-per-repair add (W cloudkeep 50))    ;  Wizards slowly repair cloud castles
  518. (table acp-to-repair add (G foot 1))
  519. (table hp-per-repair add (G foot 50))
  520.  
  521. (table acp-to-repair add (bases u* 1))
  522. (table hp-per-repair add (bases u* 100))
  523. (table acp-to-repair add (forts u* 1))
  524. (table hp-per-repair add (forts u* 100))
  525. (table acp-to-repair add (cities u* 1))
  526. (table hp-per-repair add (cities u* 100))
  527. (table acp-to-repair add (forts forts 1))
  528. (table hp-per-repair add (forts forts 25))    ; forts have a few people who can fix them
  529. (table acp-to-repair add (cities cities 1))
  530. (table hp-per-repair add (cities cities 25))    ; cities have the people to maintain themselves...
  531. (table acp-to-repair add (c ( i cloudkeep h ) 1))
  532. (table hp-per-repair add (c ( i cloudkeep h ) 100))
  533. (table acp-to-repair add (T ( W ) 1))
  534. (table hp-per-repair add (T ( W ) 100))
  535. (table acp-to-repair add (t foot 1))
  536. (table hp-per-repair add (t foot 100))
  537.  
  538. (table mp-to-enter-unit add (flyers u* 20))    ; aircraft can't sortie again until next turn
  539. (table mp-to-enter-unit add (ships bases 20))
  540. (table mp-to-leave-unit add (ships bases 1))
  541.  
  542. ;;; Combat.
  543.  
  544. ; HP of various units.
  545. (define units ( W i b k P R H s D u h A L F M E G C  cloudkeep S g  w  c  T  /  t  V  *  @ ))
  546. (add units hp-max ( 2 2 2 3 4 2 2 2 8 4 3 1 1 1 2 1 2 1 10 4 3 10 20  8  4  8 15 30 45 ))
  547. ;FIX in addition you can set hp-to-repair and other things to cripple a unit
  548. ;(add units hp-at-min-speed ( 1 1 1 1 1 0 1 0 3 0 2 1 1 1 1 1 1 0  4 2 1  2  3  4  2  2  8 16 25 ))
  549. ; NOTE: crippled is at <= value, not <
  550.  
  551. (add spells hp-max 2)    ; not 1 so that they can survive an attack when attacking.
  552. ;(add spells hp-at-min-speed 0)
  553. ; 1 M hp ; So mass charm survives the attack to capture!
  554.  
  555. ; split the matrix in half to make it fit on an 80 col screen!
  556. (define u1 (  W   i   b   k   P   R   H   s   D   u   G   C   h ))
  557. (define u2 (  A   L   F   cloudkeep   S   g   w   c   T   /   t   V   *   @ ))
  558. ; (chances) u# unit hit
  559. ; chances for unit to hit member of u#
  560.  
  561. ; so, here we define the units by how good they are at hitting others
  562. ; ranges:  30% is typical attack percent.
  563. ; it ranges up and down from there...
  564. ;( W   i   b   k   P   R   H   s   D   u   G   C   h ) u1
  565. (table hit-chance add (W u1 ( 25  35  10  30  10  35  20  40  40  30  40  40  30 )))
  566. (table hit-chance add (i u1 ( 50  30  40  20  15  60  25  45  10  20  40  30  20 )))
  567. (table hit-chance add (b u1 ( 45  45  35  25  25  55  35  45  15  30  50  20  25 )))
  568. (table hit-chance add (k u1 ( 35  40  45  25  20  65  30  50  20  30  30  15  30 )))
  569. (table hit-chance add (P u1 ( 40  40  45  35  30  80  30  30  40  50  30  15  30 )))
  570. (table hit-chance add (R u1 ( 30  45  50  25  20  65  30  40  20  15  30  30  25 )))
  571. (table hit-chance add (H u1 ( 30  20  35  20  20  50  35  30  10  45  30  10  20 )))
  572. (table hit-chance add (s u1 ( 20  10  15   5   3  10  10  30   1  10  30   5  10 )))
  573. (table hit-chance add (D u1 ( 40  50  55  35  20  70  40  80  30  40  60  40  80 )))
  574. (table hit-chance add (u u1 ( 20  30  35  20  10  50  10  50  10  30  40  30  30 )))
  575. (table hit-chance add (A u1 ( 50  99  60  90  70  90  80  99  60  99  99  99  99 )))
  576. (table hit-chance add (L u1 ( 50  80  50  90  60  80  80  99  70  99  99  99  99 )))
  577. (table hit-chance add (F u1 ( 50  90  50  80  60  90  80  99  60  99  99  99  99 )))
  578. (table hit-chance add (G u1 (  0   0   0   0   0   0   0   0   0   0   0   0   0 )))    ; noncombatants
  579. (table hit-chance add (C u1 (  0   0   0   0   0   0   0   0   0   0   0   0   0 )))    ; noncombatants
  580. (table hit-chance add (K u1 ( 10   5   5   5   5   5   5   5  25   5  15  20   5 )))    ; Cloudkeep can drop rocks!
  581. (table hit-chance add (h u1 ( 50  45  50  30  30  70  40  60  25  40  50  15  30 )))    ; Cavalry
  582. (table hit-chance add (S u1 (  0   0   0   0   0   0   0   0   0   0   0   0   0 )))    ; ships can only attack other ships
  583. (table hit-chance add (g u1 (  0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  584. (table hit-chance add (w u1 ( 11  30  35  20  10  40  30  40  20  30   0   0  20 )))
  585. (table hit-chance add (c u1 ( 10  40  40  25  12  40  35  40  25  35   0   0  20 )))
  586. (table hit-chance add (T u1 ( 10  35  35  20  10  40  30  40  20  30   0   0  20 )))
  587. (table hit-chance add (/ u1 (  5  20  17  15  10  25  20  30  10  20   0   0  10 )))
  588. (table hit-chance add (t u1 (  8  25  30  20  18  35  30  40  15  35   0   0  15 )))
  589. (table hit-chance add (V u1 (  9  25  30  20  15  30  30  40  15  20   0   0  25 )))
  590. (table hit-chance add (* u1 ( 10  30  35  25  20  40  35  45  20  25   0   0  30 )))
  591. (table hit-chance add (@ u1 ( 15  35  40  30  25  50  40  50  25  30   0   0  30 )))
  592.  
  593. ;( A   L   F   K   S   g   w   c   T   /   t   V   *   @ ) u2
  594. (table hit-chance add (W u2 (  1   1   1  50  30  40  25  20  25  30  35  40  40  40 )))
  595. (table hit-chance add (i u2 (  1   1   1  10  10  10  10  10  10  25  20  20  20  20 )))
  596. (table hit-chance add (b u2 (  1   1   1  10  10  10   8   5   8  40  30  50  50  50 )))
  597. (table hit-chance add (k u2 (  1   1   1  10  10  10   9   9  10  20  25  30  30  30 )))
  598. (table hit-chance add (P u2 (  1   1   1  11   7   8  15  15  15  20  40  20  20  20 )))
  599. (table hit-chance add (R u2 (  1   1   1   8   5   5   8   8   8  30  30  30  30  30 )))
  600. (table hit-chance add (H u2 (  1   1   1   3   4   4   4   4   4  20  50   5   5   5 )))
  601. (table hit-chance add (s u2 (  1   1   1   1   2   2   1   2   2  20  15  20  20  20 )))
  602. (table hit-chance add (D u2 (  1   1   1  20  60  50  30  25  28  50  40  60  60  60 )))
  603. (table hit-chance add (u u2 (  1   1   1   2  10  10  11  11  10  30  20  30  30  30 )))
  604. (table hit-chance add (A u2 (  1   1   1  30 199 199 199 150 150 299  70 130 110 100 )))
  605. (table hit-chance add (L u2 (  1   1   1  30  40  40  80  80  80  99  70  90  90  80 )))
  606. (table hit-chance add (F u2 (  1   1   1  30  99  99  60  50  69  99  75  90  90  90 )))
  607. (table hit-chance add (G u2 (  1   1   1   0   0   0   0   0   0   0   0   0   0   0 )))    ; noncombatat
  608. (table hit-chance add (C u2 (  1   1   1   0   0   0   0   0   0   0   0   0   0   0 )))    ; noncombatant
  609. (table hit-chance add (K u2 (  1   1   1  40   0   0   0   0   0   0   0   0   0   0 )))
  610. (table hit-chance add (h u2 (  1   1   1  10  10  10   6   6   9  40  35  30  30  30 )))    ;
  611. (table hit-chance add (S u2 (  1   1   1   0  20  10   0   0   0   0   0   0   0   0 )))    ; ships ramming each other!
  612. (table hit-chance add (g u2 (  1   1   1   0  50  30   0   0   0   0   0   0   0   0 )))
  613. (table hit-chance add (w u2 (  1   1   1   0   0   0   0   0   0   0   0   0   0   0 )))    ; matrix here and below  is all non-movers vs non-movers!
  614. (table hit-chance add (c u2 (  1   1   1   0   0   0   0   0   0   0   0   0   0   0 )))
  615. (table hit-chance add (T u2 (  0   1   0   0   0   0   0   0   0   0   0   0   0   0 )))
  616. (table hit-chance add (/ u2 (  0   0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  617. (table hit-chance add (t u2 (  0   0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  618. (table hit-chance add (V u2 (  0   0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  619. (table hit-chance add (* u2 (  0   0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  620. (table hit-chance add (@ u2 (  0   0   0   0   0   0   0   0   0   0   0   0   0   0 )))
  621.  
  622. (table hit-chance add (E u* 0))
  623. (table hit-chance add (M u* 10))    ; can do some damage as it attempts to capture
  624.  
  625. ; and this allows ti to even attack...
  626. (table hit-chance add (movers spells 50))    ;  spells can be killed by attacking them, but
  627. (table hit-chance add (movers M 10))    ;
  628. ; they shouldn't have much time where they can be attacked.
  629. ; they are either in-flight, or stored on someone!
  630.  
  631. ; terrain effects
  632. (table defend-terrain-effect add (foot ( forest swamp mountains hills ) 85))
  633. (table defend-terrain-effect add (hvyfoot ( forest swamp mountains hills ) 90))
  634.  
  635. (table defend-terrain-effect add (R ( forest swamp mountains hills desert ) (25 40 40 60 90)))
  636. ; archers are good at using terrain to hide in.
  637.  
  638. (table defend-terrain-effect add (forts ( hills mountains ) 60))
  639. (table defend-terrain-effect add (T ( hills mountains ) (80 50)))
  640. (table defend-terrain-effect add (c ( hills mountains ) (80 50)))
  641.  
  642. (table damage
  643.   (u* u* 1)    ; default
  644.   (D u* 2)
  645.   (u* magicitems 0)    ;  otherwise, items are always destroyed by capture
  646.   (D bases 3)
  647.   (D cities 4)
  648.   (b bases 3)    ; barbarians torch them cities!
  649.   (R D 4)    ; rangers with those special arrows!
  650.   (g ships 2)
  651.   (( P H ) u 3)
  652.   (h ltfoot 1)
  653.   (F ships 4)
  654.   (F cities 4)
  655.   (F u* 2)
  656.   (F / 4)
  657.   (L u* 3)
  658.   (M u* 1)    ; it might do some damage as the victim struggles
  659.   (A u* 21)    ; Armageddon spells are nuclear!
  660.   (magicitems u* 0)    ; magic items can't hurt anything
  661.   )
  662.  
  663. ;FIX true capturemoves    ; gotta secure newly captured units first
  664. ; false capturemoves is buggy?
  665.  
  666. ;FIX true counterattack
  667.  
  668. (table acp-to-defend add (spells u* false))    ; they're specifically targeted!
  669. (table acp-to-defend add (w u* false))    ; walls don't fight back! They're just walls!
  670. (add spells acp-to-detonate 1)
  671.  
  672.  
  673. ; stuff that can change sides when captured
  674. (add u* acp-to-change-side 0)    ; most units are fanatically loyal beings
  675. (add transport acp-to-change-side 100)    ;  inanimate units that may be captured
  676. (add magicitems acp-to-change-side 100)    ;
  677. (add ( W i b s D ) acp-to-change-side ( 20 20 40 80 20 ))
  678.  
  679. ; these units may be persuaded to go traitor
  680.  
  681. #|
  682. (table capture-chance
  683.   (W ( W i k s D u A L F G K T ) ( 20 20 20 40 20 40 30 30 30 20 50 40 ))
  684.  
  685.   ;                                 ( s  G h  S  g  w c  T  /  t  V  *  @ )
  686.   (i ( s G h S g w c T / t V * @ ) ( 40 50 5 30 30 10 5  8 30 20 40 25 15 ))
  687.   (b ( s G h S g w c T / t V * @ ) ( 40 50 5 45 40  8 3  7 40 25 20 10  7 ))
  688.   (R ( s G h S g w c T / t V * @ ) ( 10 20 5 10 10  8 3  7 40 25 45 25 10 ))
  689.   (k ( s G h S g w c T / t V * @ ) ( 45 40 5 15 10 12 6  9 35 25 45 25 13 ))
  690.   (P ( s G h S g w c T / t V * @ ) ( 50 30 8 20 20 11 7 10 36 45 40 20 10 ))
  691.   (h ( s G h S g w c T / t V * @ ) ( 50 40 5  5  5  5 1  5 60 30 40 20 10 ))
  692.   (H ( s G h           / t V * @ ) ( 60 10 10              20 35 40 15 15 ))
  693.   (u ( G S   S g w c T / t V * @ ) ( 40 50   25 30 11 6  9 20 10 15 10  5 ))
  694.  
  695.   (H ( i b u ) ( 20 15 40 ))    ; priests can convert people!
  696.   (s ( s G cloudkeep / V * @ ) ( 20 30 45 30 30 20 15 ))
  697.  
  698.   ; the Charm Spell...
  699.   (M u* 100)    ; the standard default
  700.  
  701.   (M ( 100 50 100 200 25 60 50 40 ) ( w c T / t V * @ ))
  702.   ; works better against low populations
  703.  
  704.   (M ( W P H D cloudkeep T ) ( 50 10 40 50 25 80 ))
  705.   (u* magicitems 100)    ;  magical items don't have loyalty
  706.   )
  707. |#
  708.  
  709. ;FIX ferry-on-entry is U1 U2 -> FTYPE how much terrain U2 crosses to board U1
  710. (table ferry-on-entry add (u* u* over-all))    ; lets everything attack everywhere: no terrain immunity
  711.  
  712. ; protect: # u1 u2 protect: protection offered to u1 by u2
  713. (table protection add (bases u* 70))    ; general bases protect their occupants ok
  714. (table protection add (forts u* 20))    ; forts prottect their occupants very well
  715. (table protection add (/ movers 80))
  716. (table protection add (V movers 80))
  717. (table protection add (* movers 70))
  718. (table protection add (@ movers 60))
  719. (table protection add (( i k P W ) forts 50))
  720. (table protection add (u forts 60))
  721. (table protection add (( i k P W ) bases 70))
  722. (table protection add (H temple 50))    ; priests and their temples...
  723. (table protection add (W ( cloudkeep tower ) 20))    ; wiz's protect their towers and keeps very well
  724.  
  725. ;FIX true u* neutral
  726. ;FIX false i neutral
  727.  
  728. ;FIX U1 U2 -> % that U2 withdraws before U1 attacks
  729. (table withdraw-chance-per-attack add (u* movers 10))
  730. (table withdraw-chance-per-attack add (u* R 33))    ; those rangers like to run away!
  731. (table withdraw-chance-per-attack add (u* ships 0))    ; boats can't retreat!
  732.  
  733. (table consumption-per-attack add (D food -5))    ; dragon feeds on enemies!
  734. (table consumption-per-attack add (W mana 1))    ; mages use spells in combat!
  735. (table consumption-per-attack add (K metal 1))    ; Cloudcastles throw stuff down to attack
  736.  
  737. ;FIX spy-chance is now on a per unit basis...
  738. ; and spy-range specifies how far a unit can spy
  739. (add u* spy-chance false)    ; we don't spontaneously see all the enemies
  740. ;FIX spy-quality is U1 U2 -> % that U1 returns info about U2
  741. (table spy-quality (u* u* false))    ; and we don't see any of them if we do!
  742.  
  743. ;FIX I guess nuked is damaged-terrain now, T1 T2 -> N
  744. ;FIX t* t* nuked    ; most terrain won't actually change when nuked
  745. ;FIX desert ( plains forest ) nuked    ; except forest, plains turn to desert.
  746. ;FIX mountains ice nuked    ; ice gets nuked into mountains.
  747.  
  748. ;FIX "defeats" land destroy-message
  749. ;FIX "sinks" ships destroy-message
  750. ;FIX "knocks down" flyers destroy-message
  751. ;FIX "sacks" cities destroy-message
  752. ;FIX "slays" ( D h ) destroy-message
  753.  
  754. ; NIY? 100 u* max-quality ;  what's the range of this?
  755. ; NIY? 100 u* veteran ;
  756. ; NIY? 1000 u* max-morale ;  what's the range of this?
  757. ;FIX 50 u* efficiency    ; disbanding units for their parts?
  758.  
  759. ;FIX true u* neutral    ;everything can become neutral
  760.  
  761. ;FIX hp-per-disband is U1 U2 -> HP lost in a disband action performed by U2
  762. ; you might add U1 acp-to-disband U2 as well, U1 U2 -> ACP
  763. ; (table hp-per-disband add (u* u* 100))    ; perhaps they're not so fanatic?
  764. ; (table hp-per-disband add (( W i b k D u A L F G h C S g / ) u* 100))
  765.  
  766. (add magicitems hp-max 1)    ;
  767.  
  768. ; combat stats should be irrelevant, since they're always occupants
  769. (table hit-chance add (u* magicitems 100))    ; everything can hit them
  770. (table hit-chance add (magicitems u* 0))    ; they can't hit back!
  771. (table acp-to-defend add (magicitems u* 0))
  772. (table capture-chance add (u* magicitems 100))    ; just pick them up!
  773.  
  774. (add magicitems acp-to-change-side 100)
  775. (table protection add (u* p 80))    ; ring of protection, reduces hit-chance by 20%
  776.  
  777. ; (table hp-per-disband add (magicitems u* 100))    ; they can' be destroyed!
  778. ;FIX true magicitems neutral
  779.  
  780. ;;; Scoring.
  781.  
  782. (add bases point-value ( 1 20 8 8 30 2 8 10 50 ))    ;  territory values for victory pts.
  783. (add s point-value 5)    ; serfs are valuable!
  784.  
  785. (scorekeeper (do last-side-wins))
  786.  
  787. ;( r B p f a ) magicitems
  788. ; magic items stats tacked on at the end!
  789. (table independent-density add (magicitems t* 5))    ; some random ones to be lying around easy to capture
  790. (table favored-terrain add (magicitems sea 0))    ; they'd sink!
  791. (table supply-on-completion add (magicitems m* 100))    ; they're usually statically full
  792. ;FIX ( 10 6 8 6 15 ) magicitems W make    ; wizards make them only
  793. ;FIX ( 12 12 9 4 0 ) magicitems H make    ; priests can make some items
  794. ;FIX 50 magicitems research    ; discover the magic formulae?
  795. ;FIX 25 magicitems magicitems research-contrib
  796.  
  797. (table acp-to-repair add (r u* 1))
  798. (table hp-per-repair add (r u* 100))    ; ring of regeneration magically fixes everything!
  799. ; ring must be able to hold supplies to perform repairs! Sheesh!
  800.  
  801. (table base-production add (r m* 1))    ; ring produces everything, just in case...
  802. (table base-production add (f food 6))    ; FOOD!
  803. (table base-production add (a mana 6))    ; amulet of power generates mana
  804.  
  805. (table productivity add (magicitems t* 100))
  806.  
  807. (table consumption-as-occupant add (magicitems m* 0))    ; they dont consume anyway!
  808. (table mp-to-enter-terrain add (magicitems sea 99))
  809. (table mp-to-enter-terrain add (magicitems land 1))
  810.  
  811. ;(add B vision-at 10)    ; that's what its for!
  812.  
  813. ;;; Backdrop economy.
  814.  
  815. (table base-production add (W mana 5))    ; * very terrain dependent
  816. (table base-production add (D mana 4))    ; *
  817. (table base-production add (H mana 2))
  818. (table base-production add (K mana 12))
  819. (table base-production add (T mana 5))    ; *
  820. (table base-production add (t mana 2))
  821. (table base-production add (P mana 1))
  822.  
  823. ; food production
  824. ; i b k P R H  s c T / t V  *  @ K )
  825. (table base-production add (( i b k P R H s c T / t V * @ K ) food ( 2 4 2 3 6 4 10 2 1 3 6 8 12 16 3 )))
  826. (table base-production add (W food 1))
  827.  
  828. ; metal production
  829. (table base-production add (( H s T c V * @ ) metal ( 2 4 1 2 4 8 16 )))
  830.  
  831. (table productivity add (u* t* 100))    ;the default anyway!
  832. (table productivity add (foot sea 0))
  833. (table productivity add (hoof sea 0))
  834. (table productivity add (( H P ) sea 50))
  835.  
  836. ; sea swp des pln for hil mtn ice vac
  837. ;(  .   =   -   +   %   ~   ^   _  : ) t*
  838. (table productivity add (W t* ( 60  60  60  40  60  80 100 120  0 )))    ; 1 per 20%
  839. (table productivity add (D t* ( 75  50  50  50  75  75 100 125  0 )))    ; 1 per 25%
  840. (table productivity add (T t* (  0  60  40  40  60  80 100 120  0 )))    ; 1 per 20%
  841. ; considerable advantage for mana production on 'ice' and other
  842. ; difficult terrain.
  843. ; ice is usually highest mountain.
  844. ; note, building a T on ice is a pain, as a wiz must do it!
  845.  
  846. ; swamp/plains/forest/desert/hills/mountains = land
  847. (table productivity add (i land (  50 100  90 20  25  50 )))    ; one arg must be a scalar...
  848. (table productivity add (b land (  50 100  90 20  25  50 )))
  849. (table productivity add (k land (  00 100  90 20  25  50 )))
  850. (table productivity add (P land (  50 100 100 50 100  75 )))
  851. (table productivity add (R land ( 100 100 100 50 100 100 )))
  852. (table productivity add (H land (  75 100 100 50  75  75 )))
  853. (table productivity add (s land (  50 100  90 70  75  50 )))
  854. (table productivity add (/ land (  50 100  90 70  75  50 )))
  855. (table productivity add (t land (  50 100  90 70  75  50 )))
  856. (table productivity add (V land (  50 100  90 25  75  50 )))
  857. (table productivity add (* land (  50 100  90 25  75  50 )))
  858. (table productivity add (@ land (  50 100  90 25  75  50 )))
  859.  
  860. (table productivity add (ships sea 100))
  861. (table productivity add (K t* 100))
  862.  
  863.  
  864. ; units' comsumption
  865. (table base-consumption add (movers food 1))    ; all consume 1 food per turn, except...
  866. (table base-consumption add (( i k ) food 2))    ; many infantry per unit, knights are pigs
  867. (table base-consumption add (D food 2))    ; dragons are voracious!
  868. (table base-consumption add (undead food 0))    ; just skeletons, not ghouls!
  869. (table base-consumption add (spells food 0))
  870. (table base-consumption add (C food 0))
  871. (table base-consumption add (( h G ) food 2))    ; horses eat a lot
  872. (table base-consumption add (g food 1))    ; crew needs to eat more when active
  873.  
  874. (table base-consumption add (spells mana 1))    ; spells burn mana in-flight
  875. (table base-consumption add (C mana 1))    ; magic carpet burns mana in flight.
  876.  
  877. ; mutual supply rules:
  878. ; consume-as-occupant is cool!  1 means they do consume!
  879. (table consumption-as-occupant add (u* m* 1))
  880. (table consumption-as-occupant add (spells m* 0))    ; spells in storage require no mana support
  881. (table consumption-as-occupant add (ships m* 0))    ; ships not at sea need no food...
  882.  
  883. ; inlength is how far away a unit can receive fuel from
  884. ; out-length is how far away a unit can deliver fuel.  Should be kept
  885. ; small, as it can waste much CPU time
  886. ;
  887. ;set the supply line the defaults...
  888.  
  889. (table out-length add (movers m* 0))    ; most movables can't supply other things.
  890. (table out-length add (bases m* 1))    ; bases somewhat supply neighbors
  891. (table out-length add (cities m* 2))    ; cities trade with surrounding lands
  892. (table out-length add (W mana 0))    ; mages selfishly hoard magic to themselves.
  893. (table out-length add (G food 2))    ; wagons are supply vehicles
  894. (table out-length add (s m* 1))    ; serfs will trade supplies to units near them
  895. (table out-length add (K m* ( 0 3 0 )))    ; flying citadel magically transmits its mana
  896. (table out-length add (magicitems m* 0))
  897. (table out-length add (a mana 2))
  898.  
  899. (table in-length add (movers m* 1))    ; but they can be supplied by nearby things.
  900. (table in-length add (bases m* 1))    ; bases can recieve things from neighbors.
  901. (table in-length add (spells mana -1))    ; you have to charge the spells yourself
  902. (table in-length add (s m* 1))
  903. ; 0 mana bases in-length ; They generate it, not take it!
  904. ; leave it with normal  in-length -- bases can exchange with each other.
  905. (table in-length add (magicitems m* 0))
  906. (table in-length add (a mana -1))    ; it doesn't take mana, just give it!
  907.  
  908. ;FIX survival is now hp-per-starve U M -> HP
  909. (table hp-per-starve add (( R b ) m* 75))    ; archer, barbarian can live off the land.
  910. (table hp-per-starve add (( H P ) m* 50))    ; holy dudes are used to fasting
  911. (table hp-per-starve add (s m* 33))    ; peasants don't need the food that badly... :-)
  912.  
  913. ;;; Random events.
  914.  
  915. ; disasters: units are in HUNDREDTHS of a percent each TURN
  916. (add magickers revolt-chance 5)    ; sure, tell wizards and dragons orders! Good luck!
  917. (add b revolt-chance 5)    ; those crazy barbarians
  918. (add s revolt-chance 100)    ; Serfs dont' enjoy being oppressed
  919.  
  920. ;FIX surrender is U1 U2 -> .01N chance that U1 surrenders to U2
  921. ; and surrender-range is distance at which it can occur
  922. (table surrender-chance add (forts u* 50))
  923. (table surrender-chance add (cities u* ( 100 60 30 )))
  924. ;FIX 1500 bases siege    ; most things could be sieged easily
  925. ;FIX 350 forts siege    ; rare for a siege to take a fort...
  926. ;FIX ( 1500 3000 3000 ) ( V * @ ) siege    ; medieval cities fell easily
  927. ;FIX 0 cloudkeep siege
  928. (table surrender-chance add (K u* 0))
  929.  
  930. ; attrition. Mostly ships at sea
  931. ;FIX attrition is U T -> .01HP (rate of loss, hp/turn)
  932. (table attrition add (ships sea ( 200  1000  )))
  933. ;FIX "gets caught in a storm" ships attrition-message
  934.  
  935.  
  936. ;FIX accident is U T -> .01N chance that an accident happens to U
  937. ; and you can set accident-damage
  938. (table accident-hit-chance add (ships sea ( 10 50 )))    ; ships arent too seaworthy...
  939. ;FIX "lost in a storm" ships accident-message
  940.  
  941. ;heavy-foot units should have accidents in swamp and/or mountains
  942. (table attrition add (foot ( mountains  swamp ) 100))
  943. (table accident-hit-chance add (foot ( mountains  swamp ) 50))
  944. (table attrition add (hvyfoot ( mountains swamp ) 200))
  945. (table accident-hit-chance add (hoof ( mountains swamp ) 100))
  946. (table attrition add (hoof ( mountains swamp ) 300))
  947. ;FIX "fell down and couldn't get up!" foot accident-message
  948. ;FIX "broke down and had to be destroyed." hoof accident-message
  949.  
  950.  
  951. ;and magickers should have 'accidents'
  952. (table attrition add (magickers t* 50))
  953. ;FIX "had a dangerous Arcane accident" magickers attrition-message
  954. (table accident-hit-chance add (magickers t* 5))
  955. ;FIX "returns to its lair to hibernate and disappear into legend" D accident-message
  956. ;FIX "disappears into a puff of smoke" W accident-message
  957.  
  958. ;;; Setup.
  959.  
  960. ; sea swp des pln for hil mtn ice vac
  961. ;(  .   =   -   +   %   ~   ^   _  : )
  962. (add t* alt-percentile-min (   0  29  70  70  70  75  93  99  0 ))
  963. (add t* alt-percentile-max (  69  71  93  93  93  98  99 100  0 ))
  964.  
  965. (add t* wet-percentile-min (   0  50   0  20  80   0   0   0  0 ))
  966. (add t* wet-percentile-max ( 100 100  20  80 100  99 100 100  0 ))
  967. ; ranges at which we see the various terrain types
  968. ; units are altitude
  969. ; first is for altitude
  970. ; next is for  wetness
  971.  
  972. ;FIX this is broken into alt-blob-size, etc. etc.
  973. ;FIX 45 alt-roughness    ; 0-100  the higher this is, the more altitude roughness
  974. ;FIX this is broken into wet-blob-size, etc. etc.
  975. ;FIX 80 wet-roughness    ; Similar to alt-roughness
  976.  
  977. (set edge-terrain void)    ; Edge of the world: you'll fall off!
  978.  
  979. (set country-radius-min 4)    ;  the radius of a 'country'
  980. (set country-separation-min 17)    ;  the closest a country may be
  981. (set country-separation-max 90)    ;  the furthest apart a country may be.
  982.  
  983. (add cities start-with ( 1 2 1 ))    ; units player starts with
  984. (add ( c s temple W ) start-with ( 1 4 1 1 ))    ; some more misc units
  985.  
  986. (table independent-density 
  987.   (V land 60)
  988.   (* land 30)
  989.   (@ land 15)
  990.   ; some rare freaks to find
  991.   (K t* 1)
  992.   (s plains 50)
  993.   (W land 2)
  994.   (C land 5)
  995.   (T land 10)
  996.   (t land 20)
  997.   (D (plains mountains) 5)
  998.   )
  999.  
  1000. (table favored-terrain 
  1001.   (u* sea 0)
  1002.   (u* land 30)
  1003.  
  1004.   (forts land 100)
  1005.  
  1006.   (K t* 100)    ; the flying citadel(s) could be anywhere!
  1007.   (K void 0)    ; but the void, of course
  1008.  
  1009.   (magickers land 30)
  1010.   (magickers hills 60)
  1011.   (magickers mountains 100)
  1012.  
  1013.   (s land ( 20 100 80 10 40 20 ))
  1014.  
  1015.   (hoof mountains 0)    ; just in case...
  1016.  
  1017.   (cities land 20)
  1018.   (cities plains 100)
  1019.  
  1020.   (u* void 0)    ; nothing goes in void
  1021.   )
  1022.  
  1023. (add cloudkeep already-seen 0)    ; the K's shouldn't be seen
  1024.  
  1025. (add u* initial-seen-radius 5)
  1026.  
  1027. (include "ng-weird")
  1028.  
  1029. (add (W D) namer "short-generic-names")
  1030. (add cities namer "short-generic-names")
  1031.  
  1032. ;(set random-events (units-revolt units-revolt units-revolt))
  1033.  
  1034. ;;; Documentation.
  1035.  
  1036. (game-module (instructions (
  1037.   )))
  1038.  
  1039. (game-module (notes (
  1040.   )))
  1041.  
  1042. (game-module (design-notes (
  1043.   )))
  1044.